fix(agents): harden format guard review findings - #2995
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 27 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe validator now detects more concrete task targets. The format-guard workflow delays API setup, revalidates live issue state before label changes, and dispatches the optimizer only for open issues. Tests cover these paths. ChangesIssue format guard
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow
participant IssueResolver
participant GitHubAPI
participant issue_format_py
participant Optimizer
Workflow->>IssueResolver: Resolve issue and export state
Workflow->>GitHubAPI: Fetch live issue
GitHubAPI-->>Workflow: Return state and body
Workflow->>issue_format_py: Validate issue body
issue_format_py-->>Workflow: Return validation result
Workflow->>GitHubAPI: Preserve or remove agents:formatted
Workflow->>Optimizer: Dispatch only for open valid issues
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Workflow source neededPR #2995 needs either a linked GitHub issue or one valid non-issue Workflow Source before PR metadata automation can manage it safely. Please do one of:
Once a valid source is present, this warning will not be reposted. |
There was a problem hiding this comment.
Pull request overview
Hardens the “issue format guard” workflow and shared issue-format validator to reduce unnecessary side effects (especially for exempt/held/closed issues) and improve recognition of concrete task targets in issue bodies across both this repo and the consumer template.
Changes:
- Defer API client setup until it’s actually needed (non-exempt and non-held) and add issue state (
OPEN/CLOSED) to resolved outputs. - Re-fetch and re-validate the live issue body before clearing
agents:formatted, and skip optimizer routing (and label side effects) for closed issues. - Expand “concrete target” detection to include lowerCamelCase identifiers and unquoted symbol tokens; update tests accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/agents-issue-format-guard.yml |
Defers API client setup, adds state output, and revalidates live issue before label/routing side effects; skips closed issues. |
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml |
Mirrors the same guard hardening changes for consumer repos. |
.github/scripts/issue_format.py |
Accepts lowerCamelCase identifiers and recognizes concrete unquoted symbol tokens in task items. |
templates/consumer-repo/.github/scripts/issue_format.py |
Mirrors the same validator logic changes for consumer repos. |
tests/workflows/test_agents_issue_optimizer_format_trigger.py |
Adds assertions covering new guard ordering/conditions and closed-issue skipping behavior. |
tests/scripts/test_issue_format.py |
Extends validator coverage to ensure lowerCamelCase identifiers are accepted as concrete task targets. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78b4d712c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Automated Status SummaryHead SHA: a6ad98f
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Low Coverage Files (<50.0%)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
|
Runner dispatch state for autofix on PR #2995. Do not edit. |
|
Runner dispatch state for codex on PR #2995. Do not edit. |
|
Autofix updated these files:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/agents-issue-format-guard.yml:
- Around line 68-75: Move Setup API client in
.github/workflows/agents-issue-format-guard.yml after validation and require the
issue to be open, non-exempt, non-held, and steps.validate.outputs.rc == '1'.
Apply the same workflow change in
templates/consumer-repo/.github/workflows/agents-issue-format-guard.yml. Update
tests/workflows/test_agents_issue_optimizer_format_trigger.py to assert
validation precedes setup and setup requires state == 'OPEN' and rc == '1'.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: bb66df3b-e5c1-46ac-a378-c5787826d74f
📒 Files selected for processing (6)
.github/scripts/issue_format.py.github/workflows/agents-issue-format-guard.ymltemplates/consumer-repo/.github/scripts/issue_format.pytemplates/consumer-repo/.github/workflows/agents-issue-format-guard.ymltests/scripts/test_issue_format.pytests/workflows/test_agents_issue_optimizer_format_trigger.py
Closer recovery (cursor) — Codex P2 camelCase + CIHead: Autofix already landed the Black reformat () and a langsmith worker bump (). This closer commit rebases on those and adds:
positional arguments: options: Validationno tests ran in 0.00s → 44 passed
Review thread resolved on this head. Awaiting fresh CI + 7-minute post-push review window before merge (mandatory post-push invariant). |
Closer recovery (cursor) — Codex P2 camelCase + CIHead: Autofix already landed the Black reformat (
Validation
Review threads resolved on this head. Awaiting fresh CI + 7-minute post-push review window before merge (mandatory post-push invariant). |
Restrict unquoted concrete-target matching to lowerCamelCase so brand prose like GitHub/JavaScript cannot falsely satisfy the format guard, and reformat the optimizer trigger tests for CI black. Co-authored-by: Cursor <cursoragent@cursor.com>
abad9ab to
80def37
Compare
|
Closer recovery: rebased the exact PR head onto current main and force-pushed 80def37. The only conflict was generated langsmith-fleet-worker-attempt attribution; preserved main's current PR #2997 attribution rather than overwriting it. Validation: 44 focused tests passed; API-wrapper guard, template completeness/sync, and diff check passed. CI/review window now restarts from the new head before any merge. |
Summary
agents:formatted; skip closed issues before any routing side effectcalculateDiscountValidation
python -m pytest -q tests/scripts/test_issue_format.py tests/workflows/test_agents_issue_optimizer_format_trigger.py(42 passed)python scripts/check_template_drift.py --allowlist config/template-drift-allowlist.txt(0 unallowlisted drift)git diff --checkRelated to source-owned review debt on stranske/Trend_Model_Project#5800.
Summary by CodeRabbit
Bug Fixes
Tests